<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no">
		<title>let</title>
		<link rel="icon" href="../img/favicon.ico" />
		<script type="text/javascript">
			//代码块
			{
				let num = 10
				var sum = 20
				//let 声明的变量在当前代码块中有效
				console.log("1===>"+num)
		}
			//20 变量提示，var声明的变量，会在使用前，先声明，而且是全局作用域
			console.log(sum)
			//Uncaught ReferenceError: num is not defined
			console.log(num)
		</script>
	</head>
	<body>
		<div id="app">
			<!-- todo -->
		</div>
	</body>
</html>
